package com.young.domain;


public enum CommunicationTypeEnum {
    /** 注册 */
    REGISTER(1,"register"),
    /** 心跳 */
    HEARTBEAT(2,"heartbeat"),
    /** 取消注册 */
    UNREGISTER(3,"unregister");

    private int type;
    private String desc;

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    CommunicationTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static CommunicationTypeEnum valueOf(int type) {
        for(CommunicationTypeEnum e : values()) {
            if(e.type == type) {
                return e;
            }
        }
        return null;
    }
}
